package com.SyDeck.sdRPGmod;

import com.SyDeck.sdRPGmod.Interface.ConsoleHandler;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;

/**
 *
 * @author Deck & Sammy
 */
public class dayCmd implements CommandExecutor {

    private final sdRPGMod plugin;

    public dayCmd(sdRPGMod plugin) {
        this.plugin = plugin;
    }

    public boolean onCommand(CommandSender sender, Command command, String label, String[] string) {
        String[] args = string;
        String cmd = command.getName().toLowerCase();
        if (cmd.equals("day")) {
            return dayMethod(sender, args);
        }
        return false;
    }

    private boolean dayMethod(CommandSender sender, String[] args) {
        if (sender.isOp()) {
            String dia = "time set 0";
            ConsoleHandler.queueConsoleCommand(sender.getServer(), dia);
            return true;
        }
        return false;
    }
}
